class Person{
	String name = "张三";
	int age = 12;
	//默认构造函数
	Person(this.name,this.age);
	//Person(sex,city){
	//	print("sex:$sex city:$city");
	//}
	//命名构造函数
	Person.now(String name,int age){
	this.name = name;
	this.age = age;
		//print(uname);
	}
	void getInfo(){
		print(name);
		print(this.name);
	}
	
	void setinfo(){
		this.name = "小明";
	}
}
void main(){

	
	//默认构造函数
	//Person person = new Person('男',"北京");
	//person.getInfo();
	//print("dart:============================>");
//	print(person.name);
//	person.age = 20;
//	print(person.age);
	
//	print("改变类的属性值:============================>");
//	person.setinfo();
//	print(person.name);
	
	//命名构造函数 调用
	Person p1 = new Person.now("小红",100);
	print(p1.name);

}

